package com.lms.demo.fileservice.filter;


import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.springframework.stereotype.Component;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;

/**
 * @Author: 李孟帅
 * @CreateTime: 2020-12-29 15:03
 * @Description:
 */
//@Component
public class RequestFilter implements Filter {


    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        HttpServletRequest request1 = (HttpServletRequest) request;

        chain.doFilter(new RewriteHttpServletRequest(request1), response);
        System.out.println("==============================filter==========================");


    }

    @Override
    public void destroy() {

    }
}
